package com.lsj.controller;

import com.lsj.dao.UserMapper;
import com.lsj.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/oneController")
public class OneController {
    @Autowired
    private UserMapper userMapper;
    @RequestMapping("/test")
    public String test(){
        System.out.println("test+++++++++++++++++++++++++++");
        System.out.println(userMapper.selectByPrimaryKey(123).getUsername());
        return "test";
    }

    @RequestMapping("/getuser")
    @ResponseBody
    public User test2(){
        System.out.println("test+++++++++++++++++++++++++++");
        return userMapper.selectByPrimaryKey(123);
    }
}
